package com.project.rfidpage.controller;


import com.github.pagehelper.PageInfo;
import com.project.rfidpage.aop.TagLog;
import com.project.rfidpage.dto.LineRfidDailyParam;
import com.project.rfidpage.service.LineRfidDailyService;
import com.project.rfidpage.util.RestResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/rfidpage/linerfid/daily/")
public class LineRfidDailyController extends BaseController {

    @Resource
    LineRfidDailyService lineRfidDailyService;

    /**
     * 基RID系统基站和电子标签运行情况汇总列表查询
     */
    @PostMapping("page")
    @TagLog(operation = 0, content = "查询RID系统基站和电子标签运行情况汇总列表")
    public RestResult page(@RequestBody LineRfidDailyParam param) {
        this.getPage(true, param);
        return RestResult.ok(new PageInfo<>(lineRfidDailyService.getListForPage(param)));
    }

    /**
     * RID系统基站和电子标签运行情况汇总导出列表
     */
    @PostMapping("output")
    @TagLog(operation = 5, content = "导出RID系统基站和电子标签运行情况汇总列表")
    public RestResult dailyOutput(@RequestBody LineRfidDailyParam param) {
        this.getPage(false, param);
        return RestResult.ok(lineRfidDailyService.getListForPage(param));
    }
}
